import apiClient from '@/apis/axios.js';

export class followApi {

    //添加关注
    static async addFollow(followee_id) {
        try {
            const response = await apiClient.post('/follow/add', {
                followee_id
            });
            return response;
        } catch (error) {
            throw new Error(error.message);
        }
    }

    //删除关注
    static async deleteFollow(followee_id) {
        try {
            const response = await apiClient.post('/follow/delete', {
                followee_id
            });
            return response;
        } catch (error) {
            throw new Error(error.message);
        }
    }

    //检查关注
    static async checkFollow(followee_id) {
        try {
            const response = await apiClient.post('/follow/check', {
                followee_id
            });
            return response;
        } catch (error) {
            throw new Error(error.message);
        }
    }

    //获取关注
    static async fetchFollow(user_id) {
        try {
            const response = await apiClient.post('/follow/followee', {
                user_id
            });
            return response;
        } catch (error) {
            throw new Error(error.message);
        }
    }

    //获取粉丝
    static async fetchFan(followee_id) {
        try {
            const response = await apiClient.post('/follow/fans', {
                followee_id
            });
            return response;
        } catch (error) {
            throw new Error(error.message);
        }
    }
}